﻿<Window x:Class="SimpleChat.CreateServerWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        DataContext="{Binding CreateServer, Source={StaticResource Locator}}"
        
        mc:Ignorable="d" 
        Title="Create Server" Width="300" Height="200">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <TextBlock Grid.Column="0" Grid.Row="0" Text="Nom du Salon :" Margin="5" />
        <TextBox Grid.Column="1" Grid.Row="0" Margin="2" Text="{Binding ServerName, Mode=TwoWay}" />

        <TextBlock Grid.Column="0" Grid.Row="1" Text="Mot de passe :" Margin="5" />
        <TextBox Grid.Column="1" Grid.Row="1" Margin="2" Text="{Binding ServerPassword, Mode=TwoWay}" />
        
        <TextBlock Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
                   HorizontalAlignment="Stretch" Margin="5" TextWrapping="Wrap"
                   Text="Laissez vide si vous ne voulez pas protéger votre salon par un mot de passe." />

        <TextBlock Grid.Column="0" Grid.Row="3" Text="Nom d'Utilisateur :" Margin="5" />
        <TextBox Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Username, Mode=TwoWay}" />
        
        <Separator Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" />

        <Button Grid.Column="0" Grid.Row="5" HorizontalAlignment="Center" Width="100"
            Content="Annuler" IsCancel="True" />
        <Button Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center" Width="100"
            Content="Créer" IsDefault="True" Click="Button_Click" />
        
    </Grid>
</Window>
